import 'package:flutter/material.dart';

// 抽屉组件
class DrawerWidget extends StatefulWidget {
  const DrawerWidget({super.key, required this.des});
  final String des;

  @override
  State<StatefulWidget> createState() => _DrawerWidgetState();
}

class _DrawerWidgetState extends State<DrawerWidget> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        padding: EdgeInsets.zero,
        children: <Widget>[
          DrawerHeader(
            decoration: const BoxDecoration(
              color: Colors.purpleAccent,
            ),
            child: Text(
              widget.des,
              style: const TextStyle(
                color: Colors.white,
                fontSize: 24,
              ),
            ),
          ),
          ListTile(
            title: const Text('关于我们'),
            onTap: () {
              // 处理菜单项点击事件
            },
          ),
          ListTile(
            title: const Text('版本介绍'),
            onTap: () {
              // 处理菜单项点击事件
            },
          ),
        ],
      ),
    );
  }
}
